<!--
Date: 2025-08-13
Copyright (c) 2025 CAX Conversion Project
-->
<template>
  <el-dialog v-model="dialogVisible" title="运行日志" width="800" :before-close="closeDialog">
    <div class="b-1 b-#cccccc b-solid p2 line-height-7" v-html="log"></div>
    <template #footer>
      <div class="dialog-footer text-center">
        <el-button type="primary" @click="closeDialog">关闭</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup name="OperationLogDialog" lang="ts">
const dialogVisible = ref(false);
const log = ref('');
const openDialog = (str) => {
  console.log(str);
  const newStr = str.replace(/\u0000\u0000\r\n/g, '<br>');
  log.value = newStr;
  dialogVisible.value = true;
};
const closeDialog = () => {
  dialogVisible.value = false;
};
defineExpose({
  openDialog,
  closeDialog
});
</script>
<style lang="scss" scoped></style>
